﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Com.Crc.PoJo.Model.Resource;
using Com.Crc.ResManage.DAL.EquipManage;
using System.Collections;

namespace Com.Crc.ResManage.BLL.EquipManage
{
    public class BroadBandManageBLL
    {
        BroadBandManageDAL dal = new BroadBandManageDAL();

        /// <summary>
        /// 新增宽带设备信息
        /// </summary>
        /// <param name="data">model实体</param>
        /// <returns></returns>
        public bool AddWLANData(WLANEntity data)
        {
            try
            {
                return dal.AddWLANData(data);
            }
            catch(Exception ex)
            {
                string strError = ex.Message.ToString();
                return false;
            }
        }

        /// <summary>
        /// 修改宽带设备信息
        /// </summary>
        /// <param name="data">model实体</param>
        /// <returns></returns>
        public bool UpdateWLANData(WLANEntity data)
        {
            try
            {
                return dal.UpdateWLANData(data);
            }
            catch (Exception ex)
            {
                string strError = ex.Message.ToString();
                return false;
            }
        }

        /// <summary>
        /// 查询宽带设备信息
        /// </summary>
        /// <param name="strBranchID">分局ID</param>
        /// <param name="strOfficeID">局点ID</param>
        /// <param name="strEquipID">设备ID</param>
        /// <returns></returns>
        public DataTable QueryWLANData(string strBranchID, string strOfficeID, string strEquipID)
        {
            try
            {
                BroadBandManageDAL dal = new BroadBandManageDAL();
                return dal.QueryWLANData(strBranchID, strOfficeID, strEquipID);
            }
            catch (Exception ex)
            {
                string strError = ex.Message.ToString();
                return null;
            }
        }

        /// <summary>
        /// 删除设备，修改状态位
        /// </summary>
        /// <param name="wlanList"></param>
        /// <returns></returns>
        public bool DeleteWLANData(ArrayList wlanList)
        {
            try
            {
                BroadBandManageDAL dal = new BroadBandManageDAL();
                return dal.DeleteWLANData(wlanList);
            }
            catch (Exception ex)
            {
                string strError = ex.Message.ToString();
                return false;
            }
        }
    }
}
